import { Connection } from 'typeorm';
import { DB_CONNECTION_TOKEN, PERMISSION_CONTROL_REPO } from '../../const';
import { PermissionControlEntity } from './permission-control.entity';

export const PermissionControlProviders = [
  {
    provide: PERMISSION_CONTROL_REPO,
    inject: [DB_CONNECTION_TOKEN],
    useFactory: (connection: Connection) => connection.getRepository(PermissionControlEntity),
  },
];
